Skip to content

chore: remove comments and encode what they explained - #219

Merged
CodeWithMa merged 6 commits into
CodeWithMa:devfrom
CodeWithMaBot:chore/no-comments-sweep
Nov 26, 2026
Merged

CodeWithMa merged 6 commits into
CodeWithMa:devfrom
CodeWithMaBot:chore/no-comments-sweep

Conversation

@CodeWithMaBot

@CodeWithMaBot CodeWithMaBot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Removes comments across the whole codebase, specs included, and fixes the code that needed a comment to be understood.

  • Comment sweep (3 commits): about 240 comment lines removed from 81 files. Kept only comments about behaviour we can't change (jsdom, fake-indexeddb, IndexedDB, Zod, Playwright on NixOS, GitHub Pages, Compose) and tooling directives.
  • CSP hash: removing a comment inside the inline theme script changed its sha256, so the hash is recomputed in src/index.html and containers/nginx.conf.
  • CSP parity spec: src/content-security-policy.spec.ts fails if the meta and nginx policies drift (apart from frame-ancestors) or if script-src doesn't match the inline script hashes. This replaces the "must stay in sync" comment. tsconfig.spec.json now includes node types.
  • Dead catches: importSettings and BrowserSettingsStorage.read never throw, so the empty catch blocks in ImportExportService and ItemSortService and the spec that forced a throw are removed.
  • Names instead of prose: deleteUnavailablePosterIds, focusWindowWhenPickerCloses, a REMOVE marker and named patch types in ItemEdit, clearPendingImportIfStill in settings, linkedSignal for the item card's reveal reset, and itemSnapshot in item detail.

Note: commit 16b9245 holds all four of the last refactors although its message names only the ItemEdit one.

Testing

  • bun run lint, bun run test --no-watch (1062 passed), and bun run build pass.
  • Checked that the built index.html CSP hash matches its inline script, and that the new spec fails when the script changes.
  • bun run e2e was not run: no working Chromium was available on this machine.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Adult posters remain concealed unless display mode is set to show, and revealing a poster resets when switching to another item.
    • Removing progress or season details now applies correctly when saving item edits.
    • Errors while importing preferences or loading sort settings are surfaced instead of being silently ignored.
    • Window focus is restored after a file picker closes when supported.

CodeWithMaBot and others added 6 commits November 26, 2026 18:02
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The inline theme script lost a comment, so its CSP sha256 is
recomputed in both index.html and nginx.conf.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The spec checks that the meta and header policies match apart from
frame-ancestors, and that script-src allows exactly the inline script
hashes, so the sync comment in nginx.conf is no longer needed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
importSettings and BrowserSettingsStorage.read never throw, so the
empty catches in ImportExportService and ItemSortService and the spec
forcing a throw are removed. removeUnavailablePosterReferences becomes
deleteUnavailablePosterIds to say it mutates, and restoreFocus becomes
focusWindowWhenPickerCloses. Spec stubs return undefined instead of
holding comments in empty bodies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 26, 2026

Copy link
Copy Markdown

@CodeWithMaBot is attempting to deploy a commit to the Ma's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The pull request removes comments across workflows, application code, and tests. It also changes item edit patches, UI state handling, and settings error propagation, updates CSP hashes, and adds CSP consistency tests.

Changes: Application behavior updates

Layer / File(s) Summary
Edit patches and poster-reference naming
src/app/domain/item-edit.ts, src/app/domain/poster-references.ts, src/app/services/import-export.service.ts, src/app/services/storage.service.ts
Progress and season removals use a typed null sentinel. The poster-reference cleanup helper is renamed, and its callers are updated.
UI state and file interactions
src/app/components/item-card/item-card.component.ts, src/app/components/item-detail/item-detail.component.ts, src/app/components/settings/settings.component.ts, src/app/directives/file-picker-focus.directive.ts, src/app/components/item-form-navigation.spec.ts
Reveal state resets when the item ID changes. Item detail uses the renamed snapshot signal. Import cleanup uses a helper that checks file identity, and file-picker handlers use the renamed focus method.
Settings and import error handling
src/app/services/import-export.service.ts, src/app/services/import-export.service.spec.ts, src/app/services/item-sort.service.ts, src/app/services/item-sort.service.spec.ts
Provider and discussion settings import errors now propagate. Sort-setting read errors also propagate instead of falling back to defaults.

Content Security Policy alignment

Layer / File(s) Summary
Policy hashes and consistency checks
containers/nginx.conf, src/index.html, src/content-security-policy.spec.ts, tsconfig.spec.json
The CSP script hash is updated in both policies. Tests check policy parity, the Nginx frame-ancestors directive, and hashes of inline scripts. The test TypeScript configuration adds node.

Comment and test cleanup

Layer / File(s) Summary
Workflow and tooling comments
.github/workflows/*, bunfig.toml, e2e/*, electron/preload.ts, playwright.config.ts, scripts/build.mjs
Removes comments from workflow and tooling files. Their executable settings remain unchanged.
Application and test comments
src/app/components/*, src/app/domain/*, src/app/models/*, src/app/services/*, src/app/utils/*
Removes explanatory comments from application code and tests. The related implementations and assertions remain unchanged, except for the behavior changes described above.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Refactor

Merge Risk: Minimal · up to 16b92

This change mostly removes comments and renames code for clarity, with small behavior changes to item patching and settings error handling. No concrete merge-blocking risk was identified. The author reports lint, unit tests and build passing, though the browser end-to-end suite was not run.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title says the PR removes comments and encodes what they explained. The raw summary shows comment removals across about 81 files, plus code changes that carry the meaning those comments used to ho…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title says the PR removes comments and encodes what they explained. The raw summary shows comment removals across about 81 files, plus code changes that carry the meaning those comments used to hold, such as the renamed helpers (deleteUnavailablePosterIds, focusWindowWhenPickerCloses, itemSnapshot), the Remove sentinel in item-edit, and the linkedSignal in item-card. The title matches the main change. It omits the CSP hash update and the new content-security-policy spec, but the author does not need to cover every detail.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ff6d3b4f-2153-4b24-b45b-52c5ae2d860e
Commits

Reviewing files that changed from the base of the PR and between 5579153 and 16b9245.

Files selected for processing: 62

  • .github/workflows/bun-audit.yml
  • .github/workflows/ci.yml
  • .github/workflows/dependabot-automerge.yml
  • bunfig.toml
  • containers/nginx.conf
  • e2e/journey.e2e.ts
  • e2e/serve.mjs
  • electron/preload.ts
  • playwright.config.ts
  • scripts/build.mjs
  • src/app/components/conflict-recovery/conflict-recovery.component.ts
  • src/app/components/home/home.component.spec.ts
  • src/app/components/home/home.component.ts
  • src/app/components/item-card/item-card.component.ts
  • src/app/components/item-detail/item-detail.component.ts
  • src/app/components/item-form-interactions.spec.ts
  • src/app/components/item-form-navigation.spec.ts
  • src/app/components/item-list/item-list.component.spec.ts
  • src/app/components/item-mutation-feedback.ts
  • src/app/components/mutation-feedback.ts
  • src/app/components/poster-drafts.spec.ts
  • src/app/components/poster-picker/poster-picker.component.spec.ts
  • src/app/components/settings/settings.component.spec.ts
  • src/app/components/settings/settings.component.ts
  • src/app/directives/file-picker-focus.directive.ts
  • src/app/domain/availability-deferral.ts
  • src/app/domain/item-edit.ts
  • src/app/domain/poster-references.ts
  • src/app/domain/storage-schema.spec.ts
  • src/app/domain/storage-schema.ts
  • src/app/models/readonly.ts
  • src/app/services/browser-settings-storage.service.ts
  • src/app/services/group-item-mutations.spec.ts
  • src/app/services/group.service.spec.ts
  • src/app/services/group.service.ts
  • src/app/services/image-storage.service.spec.ts
  • src/app/services/image-storage.service.ts
  • src/app/services/import-export.service.spec.ts
  • src/app/services/import-export.service.ts
  • src/app/services/indexeddb-write.test-utils.ts
  • src/app/services/item-sort.service.spec.ts
  • src/app/services/item-sort.service.ts
  • src/app/services/jikan-suggestion.service.ts
  • src/app/services/poster-context-conflicts.spec.ts
  • src/app/services/poster-ownership.spec.ts
  • src/app/services/poster-reader.ts
  • src/app/services/provider-settings.service.ts
  • src/app/services/round-robin.service.spec.ts
  • src/app/services/round-robin.service.ts
  • src/app/services/session-recovery.spec.ts
  • src/app/services/storage.service.spec.ts
  • src/app/services/storage.service.ts
  • src/app/services/suggestion-search.test-utils.ts
  • src/app/services/watch-list-database.service.ts
  • src/app/utils/discussion-link.utils.ts
  • src/app/utils/progress.utils.spec.ts
  • src/app/utils/search-stream.utils.ts
  • src/app/utils/sort.utils.spec.ts
  • src/app/utils/sort.utils.ts
  • src/content-security-policy.spec.ts
  • src/index.html
  • tsconfig.spec.json
Files with no reviewable changes: 45

  • .github/workflows/ci.yml
  • .github/workflows/dependabot-automerge.yml
  • bunfig.toml
  • e2e/journey.e2e.ts
  • e2e/serve.mjs
  • electron/preload.ts
  • playwright.config.ts
  • scripts/build.mjs
  • src/app/components/conflict-recovery/conflict-recovery.component.ts
  • src/app/components/home/home.component.spec.ts
  • src/app/components/home/home.component.ts
  • src/app/components/item-list/item-list.component.spec.ts
  • src/app/components/item-mutation-feedback.ts
  • src/app/components/mutation-feedback.ts
  • src/app/components/poster-drafts.spec.ts
  • src/app/components/poster-picker/poster-picker.component.spec.ts
  • src/app/components/settings/settings.component.spec.ts
  • src/app/domain/availability-deferral.ts
  • src/app/domain/storage-schema.spec.ts
  • src/app/domain/storage-schema.ts
  • src/app/models/readonly.ts
  • src/app/services/browser-settings-storage.service.ts
  • src/app/services/group-item-mutations.spec.ts
  • src/app/services/group.service.spec.ts
  • src/app/services/group.service.ts
  • src/app/services/image-storage.service.spec.ts
  • src/app/services/image-storage.service.ts
  • src/app/services/import-export.service.spec.ts
  • src/app/services/indexeddb-write.test-utils.ts
  • src/app/services/item-sort.service.spec.ts
  • src/app/services/jikan-suggestion.service.ts
  • src/app/services/poster-context-conflicts.spec.ts
  • src/app/services/poster-ownership.spec.ts
  • src/app/services/poster-reader.ts
  • src/app/services/provider-settings.service.ts
  • src/app/services/round-robin.service.spec.ts
  • src/app/services/round-robin.service.ts
  • src/app/services/session-recovery.spec.ts
  • src/app/services/storage.service.spec.ts
  • src/app/services/suggestion-search.test-utils.ts
  • src/app/services/watch-list-database.service.ts
  • src/app/utils/discussion-link.utils.ts
  • src/app/utils/search-stream.utils.ts
  • src/app/utils/sort.utils.spec.ts
  • src/app/utils/sort.utils.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@codecov

codecov Bot commented Nov 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.30769% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...pp/components/item-detail/item-detail.component.ts 83.33% 0 Missing and 1 partial ⚠️
src/app/domain/item-edit.ts 85.71% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@vercel

vercel Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
watch-list Ready Ready Preview Nov 26, 2026 5:20pm UTC

@CodeWithMa
CodeWithMa merged commit db85167 into CodeWithMa:dev Nov 26, 2026
10 checks passed
@CodeWithMaBot
CodeWithMaBot deleted the chore/no-comments-sweep branch November 27, 2026 13:17

This branch was successfully deployed

1 active deployment
Preview — 16b92455 Deployed Nov 26, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants